package com.waterworld.watch.push;

public enum MsgTypeCode {
    HEART_BEAT(0,"心跳"),
    LOGIN(1,"登录"),
    LOCATION(2,"定位"),
    STEP(3,"计步"),
    RESUME_FACTORY(4,"恢复出厂设置"),
    SHAKE_MAKE_FRIENDS(5,"摇一摇交友"),
    //上传
    PUSH_ADDRESS_BOOK(11,"通讯录"),
    PUSH_COURSE(12,"课程"),
    PUSH_INTIMATE_SET(13,"贴心设置"),
    PUSH_SECURITY_FENCE(14,"安全围栏"),
    PUSH_SCHEDULE(15,"日程提醒"),
    //指令
    REMOTE_SHUTDOWN(21,"远程关机"),
    REMOTE_PHOTO(22,"远程拍照"),
    ONEWAY_LISTENING(23,"单向聆听"),
    //消息
    WATCH_BIND(101,"绑定消息"),
    SECURITY_FENCE(102,"安全围栏消息"),
    LOW_POWER(103,"手表低电压消息"),
    SIM_PULL_OUT(104,"SIM卡拔出消息"),
    URGENT_CALL(105,"紧急呼叫消息"),
    UPLOAD_PHOTO_OK(106,"远程拍照成功消息"),
    UPLOAD_PHOTO_FAIL(107,"远程拍照失败消息"),
    CHAT(108,"微聊消息"),
    OTHER_USER_LOGIN(109,"异地登录"),
    WATCH_BIND_OK(111,"绑定成功消息")
    ;
    private int code;
    private String msg;

    MsgTypeCode(int code, String msg) {
        this.code=code;
        this.msg=msg;
    }

    public static String getMsg(int code){
        for (MsgTypeCode r :MsgTypeCode.values()) {
            if(r.getCode()==code) return r.getMsg();
        }
        return null;
    }
    public static MsgTypeCode getByCode(int code) {
        for (MsgTypeCode msgTypeCode : values()) {
            if (msgTypeCode.getCode() == code) {
                return msgTypeCode;
            }
        }
        return null;
    }


    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }
}
